home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / utility / ffe101.zip / SOUND.SWG / 0006_CMF.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  4KB  |  84 lines

  1. ┌──────────────────────────────────┬─────────────────────────────────────────
  2. │ Creative Music File Format (CMF) │
  3. └──────────────────────────────────┘
  4.  
  5. The  CMF  file  format  consists  of  3  blocks:  the  header block, the
  6. instrument block and the music block.
  7.  
  8.  
  9. The CMF Header Block
  10. ────────────────────
  11.  
  12. ┌────────────────────────────────────────────────────────────────────────┐
  13. │ Offset    Description                                                  │
  14. ├────────────────────────────────────────────────────────────────────────┤
  15. │ 00h-03h   Contains id characters "CTMF"                                │
  16. │ 04h-05h   CMF Format Version MSB = major version, lsb = minor version  │
  17. │ 06h-07h   File offset of the instrument block                          │
  18. │ 08h-09h   File offset of the music block                               │
  19. │ 0Ah-0Bh   Clock ticks per quarter note (one beat) default = 120        │
  20. │ 0Ch-0Dh   Clock ticks per second                                       │
  21. │ 0Eh-0Fh   File offset of the music title (0 = none)                    │
  22. │ 10h-11h   File offset of the composer name (0 = none)                  │
  23. │ 12h-13h   File offset of the remarks (0 = none)                        │
  24. │ 14h-23h   Channel-In-Use Table                                         │
  25. │ 24h-25h   Number of instruments used                                   │
  26. │ 26h-27h   Basic Tempo                                                  │
  27. │ 28h-?     Title, composer and remarks stored here                      │
  28. └────────────────────────────────────────────────────────────────────────┘
  29.  
  30.  
  31. The CMF Instrument Block
  32. ────────────────────────
  33.  
  34. The  instrument  block  contains  one 16  byte  data  structure for each
  35. instrument  in  the  piece. Each record is  of  the same format as bytes
  36. 24h-33h in the SBI file format.
  37.  
  38.  
  39. The CMF Music Block
  40. ───────────────────
  41.  
  42. The  music block adheres to the standard  MIDI file format, and can have
  43. from 1 to 16 instruments.
  44.  
  45. The  music  block  consists of an  alternating  seqence of time and MIDI
  46. event records:
  47.  
  48. ┌─────┬──────────┬─────┬──────────┬─────┬──────────┬─
  49. │dTime│MIDI Event│dTime│MIDI Event│dTime│MIDI Event│ ........
  50. └─────┴──────────┴─────┴──────────┴─────┴──────────┴─
  51.  
  52. dTime  (delta  Time)  is the amount  of  time  before the following MIDI
  53. event. MIDI Event is any MIDI channel message .
  54.  
  55.  
  56. The CMF file format defines the following MIDI Control Change events:
  57.  
  58. ┌────────────────────────────────────────────────────────────────────────┐
  59. │ Control                                                                │
  60. │ Number        Control Data                                             │
  61. ├────────────────────────────────────────────────────────────────────────┤
  62. │  66h          1-127, used as markers in the music                      │
  63. │  67h          0 - melody mode, 1 = rhythm mode                         │
  64. │  68h          0-127, changes the pitch of all following notes upward   │
  65. │               by the given number of 1/128 semitones                   │
  66. │  69h          0-127, changes the pitch of all following notes downward │
  67. │               by the given number of 1/128 semitones                   │
  68. └────────────────────────────────────────────────────────────────────────┘
  69.  
  70. In rhythm mode, the last five channels are allocated for the percussion
  71. instruments:
  72.  
  73.                    ┌───────────────────────────┐
  74.                    │ Channel   Instrument      │
  75.                    ├───────────────────────────┤
  76.                    │  12h      Bass Drum       │
  77.                    │  13h      Snare Drum      │
  78.                    │  14h      Tom-Tom         │
  79.                    │  15h      Top Cymbal      │
  80.                    │  16h      High-hat Cymbal │
  81.                    └───────────────────────────┘
  82.  
  83.  
  84.